﻿using System;
using System.Windows.Forms;

namespace MarioMapEditor
{
    public partial class FormActive : Form
    {
        private readonly MainForm _parent;
        private readonly int _id;
        private int _info;

        public FormActive(MainForm mParent, int nid, int recommendinfo)
        {
            _parent = mParent;
            InitializeComponent();
            comboBox1.SelectedIndex = 0;
            _id = nid;
            _info = recommendinfo;
            comboBox1.SelectedIndex = _info == (int)ObActive.INFO.LEFT ? 0 : 1;
        }

        private void Button1Click(object sender, EventArgs e)
        {
            _parent.CreateActiveOb(_id,_info);
            Close();
        }

        private void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == 0)
            {
                _info = (int)ObActive.INFO.LEFT;
            }
            else
            {
                _info = (int)ObActive.INFO.RIGHT;
            }
        }
    }
}
